home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 2.iso / BARNET / PROGRAMMING-FAQ.TXT < prev   
Text File  |  1998-06-17  |  11KB  |  371 lines

  1.         The comp.sys.acorn.programmer FAQ
  2.  
  3. Warning: beta release.  not suitable for those of a weak disposition.
  4. Subject to change without warning.  Expires 980128
  5.  
  6. current maintainer: Matthew Wilcox
  7. email: willy@odie.barnet.ac.uk
  8.  
  9. 0. Contents
  10. 1. Notes
  11. 2. Purpose of the group
  12. 3. What programming languages and support for them are available?
  13. 4. What are the entry/exit conditions for this SWI?
  14. 5. Some nasty BASIC gotchas.
  15. 5a.  Some nasty C++ gotchas
  16. 5b.  Some nasty assembler gotchas
  17. 6. What a strange error message.  What does it mean?
  18. 7. I just don't understand how to do <this>.  Got any examples?
  19. 8. Some collections of software you may wish to look at first.
  20. 9. I have a comment/suggestion/complaint
  21. 10. Credits
  22.  
  23.  
  24. 1. Notes
  25.  
  26. This FAQ is not designed to be a repository of information.
  27. Rather, it is designed to tell people where to go looking for things.
  28.  
  29.  
  30. 2. Purpose of the group
  31.  
  32. comp.sys.acorn.programmer is a newsgroup for discussions about programming
  33. Acorn computer systems.  It is not for learning how to program in general
  34. and it is not for discussing programming techniques that are not specific
  35. to the Acorn platform.  You're much more likely to get a informative reply
  36. if you post to a group that's frequented by the experts in that subject.
  37. You may wish to try:
  38.  
  39.  * comp.lang.c
  40.  * comp.sys.arm
  41.  * comp.graphics.algorithms
  42.  * sci.math
  43.  * comp.dcom.telecom
  44.  * comp.sys.acorn.networking
  45.  
  46. for example.  Do think broader than just the fact that it's an Acorn
  47. computer that you're typing on; the issues may well be deeper.  Also, try
  48. to refrain from immediately posting when you want to know about something;
  49. is there a book that contains the answer?  Have you checked some obvious
  50. sources of information on the web?
  51.  
  52. You would be wise to check out the information contained in the StrongHelp
  53. manuals at
  54. http://freenet.barnet.ac.uk/manuals/manuals-index.html
  55.  
  56. Robin Watts also has a large archive of documentation at
  57. http://www.comlab.ox.ac.uk/oucl/users/robin.watts/Docs/
  58.  
  59. By posting you are expect an intelligent answer - in return people who may
  60. be able to supply this answer expect intelligent questions.
  61. "Usenet does not exist to do your homework for you" - questions that are
  62. easily answered by language tutorials do not give a good impression.
  63.  
  64. 3. What programming languages are available?
  65.  
  66. It's perfectly acceptable to discuss various things about programming -
  67. unless they're obviously better discussed on the appropriate group for
  68. the particular language.  In particular the language itself and standard
  69. library functions not specific to Acorn OSes should be discussed on the
  70. appropriate language group.  (Unless, of course, it's a problem about the
  71. Acorn implementation)
  72.  
  73. 3.1. Ada
  74.  
  75. Peter Burwood's GNAT port is available from
  76. ftp://micros.hensa.ac.uk/micros/arch/riscos/e/e095
  77. The older Ada/Ed port by Peter Burwood is still available from
  78. ftp://micros.hensa.ac.uk/micros/arch/riscos/c/c052
  79.  
  80. 3.2. Assembler
  81.  
  82. The BASIC Assembler is supplied in ROM.
  83. Acorn sell ObjAsm as part of Cv5, previously it was available separately.
  84.  
  85. AOFLib, by William Gibbons, allows the BASIC assembler to save AOF files.
  86. It is available from ftp://micros.hensa.ac.uk/micros/arch/riscos/e/e108/
  87. AS by Niklas Rojemo is available from
  88. ftp://micros.hensa.ac.uk/micros/arch/riscos/a/a132/
  89. ASM by Nick Roberts is available from
  90. ftp://micros.hensa.ac.uk/micros/arch/riscos/f/f029/
  91. ExtBASICasm by Darren Salt, extends the capabilities of the BASIC
  92. assembler. It is available from
  93. http://www.banoffee.demon.co.uk/arcsalt/risc.html
  94. BAX by Ben Dooks is available from http://www.doggysoft.co.uk/
  95. TLA by Frank Lancaster is available from
  96. ftp://micros.hensa.ac.uk/micros/arch/riscos/a/a119/
  97.  
  98. XXX other assemblers?
  99.  
  100. 3.3. BASIC
  101.  
  102. Interpreter supplied in ROM.
  103. Compilers available include ABC & RiscBASIC
  104.  
  105. 3.4. C
  106.  
  107. Acorn sell Norcroft C v5
  108. GCC 2.7.2 is available from
  109. ftp://micros.hensa.ac.uk/micros/arch/riscos/b/b013
  110. *but* you will also need the patch archive from
  111. http://guest.btinternet.com/~nick.burrett/patch1.zip
  112. Easy C is sold by Beebug
  113.  
  114. Documentation on C, the ANSI library, and several RISC OS libraries is in
  115. http://freenet.barnet.ac.uk/manuals/g.boden/c.zip
  116.  
  117. C libraries:
  118. RISC_OSLib (Acorn)
  119. DeskLib (Julian Smith et al)
  120. Desk (Julian Smith)
  121. OSLib (Jonathan Coxhead)
  122. Toolbox (Acorn)
  123. Unixlib ftp://micros.hensa.ac.uk/micros/arch/riscos/a/a042
  124.  
  125. 3.5. C++
  126.  
  127. Acorn sell a port of AT&T's CFront as part of C v5
  128. GCC and Easy C++ - see the section on C.
  129.  
  130. C++ specific libraries:
  131. Vista (Dave Allison)
  132. Dreamscape (Mark Seaborne) ftp://micros.hensa.ac.uk/micros/arch/riscos/e/e112
  133.  
  134. 3.6. Forth
  135.  
  136. TileForth ftp://micros.hensa.ac.uk/micros/arch/riscos/a/a111
  137. AForth ftp://micros.hensa.ac.uk/micros/arch/riscos/a/a293
  138. ForthMacs ftp://micros.hensa.ac.uk/micros/arch/riscos/c/c073
  139.     ftp://ftp.uni-stuttgart.de/pub/systems/acorn/riscos/lang/forth/forthmacs
  140. WimpForth ftp://micros.hensa.ac.uk/micros/arch/riscos/e/e096
  141.  
  142. 3.7. Fortran
  143.  
  144. f2c ftp://micros.hensa.ac.uk/micros/arch/riscos/b/b136
  145. g77
  146.  
  147. Fortran specific libraries:
  148. Fortran Friends disc 1 ftp://micros.hensa.ac.uk/micros/arch/riscos/d/d061
  149. PGPlot ftp://micros.hensa.ac.uk/micros/arch/riscos/d/d062
  150.  
  151. 3.8. Gofer
  152.  
  153. gofer ftp://micros.hensa.ac.uk/micros/arch/riscos/a/a262
  154.  
  155. 3.9. HUGS
  156.  
  157. hugs ftp://micros.hensa.ac.uk/micros/arch/riscos/d/d041
  158.  
  159. 3.10. Icon
  160.  
  161. icon ftp://micros.hensa.ac.uk/micros/arch/riscos/a/a106
  162. icon9 ftp://micros.hensa.ac.uk/micros/arch/riscos/e/e116
  163.  
  164. 3.11. Java
  165.  
  166. See Peter Naulls' Java FAQ.  http://chocky.home.ml.org/
  167.  
  168. 3.12. Lisp
  169.  
  170. XLisp ftp://micros.hensa.ac.uk/micros/arch/riscos/a/a103
  171. XLisp-Plus ftp://micros.hensa.ac.uk/micros/arch/riscos/b/b076
  172. FoolsLisp ftp://micros.hensa.ac.uk/micros/arch/riscos/c/c162
  173. CLisp ftp://micros.hensa.ac.uk/micros/arch/riscos/c/c189
  174.  
  175. 3.13. Pascal
  176.  
  177. Norcroft Pascal ftp://micros.hensa.ac.uk/micros/arch/riscos/a/a122
  178. Cambridge Pascal is commercial, but I don't know who sells it.
  179.  
  180. 3.14. Perl
  181.  
  182. Perl ftp://micros.hensa.ac.uk/micros/arch/riscos/a/a049
  183. There is a beta release of perl 5.004_04 at
  184. ftp://ftp.unfortu.net/pub/flirble/users/nick/P/
  185. (which is stable, but the names of some RISC OS specific functions will
  186. change shortly when perl 5.004_05 is released)
  187.  
  188. 3.15. Python
  189.  
  190. Python ftp://micros.hensa.ac.uk/micros/arch/riscos/e/e129
  191.  
  192. 3.15a. Sather
  193.  
  194. Sather 1.1 Compiler http://chocky.home.ml.org/sather/
  195.  
  196. 3.16. Smalltalk
  197.  
  198. Squeak http://sumeru.stanford.edu/tim/
  199.  
  200.  
  201. 4. What are the entry/exit conditions for this SWI?
  202.  
  203. There are freely available manuals including Guttorm Vik's StrongHelp (other
  204. editors are also available ;-)
  205. http://login.eunet.no/~guttorvi/strong.html
  206.  
  207. Justin Fletcher also has one available in HTML from
  208. http://users.essex.ac.uk/users/gerph/acorn/prog.html
  209.  
  210.  
  211. 5. Some nasty BASIC gotchas.
  212.  
  213. Q: Why does BASIC print a silly number of decimal places when I use STR$?
  214. A: Check the setting of the @% variable.  You probably need to put a + at
  215.    the front.
  216.  
  217. Q: Why is this multiline IF statement not working?
  218. A: Ensure there's no blank space after the THEN.  The THEN must be the
  219.    very last thing on the line or it will not be treated as a multiline IF.
  220.    To fix this, try:
  221.     !Edit:
  222. with `wildcarded expressions' turned on,
  223. Find:THEN^ $
  224. Replace with:THEN$
  225.  
  226.     !Zap:
  227. with Raw and '\' commands enabled, 
  228. search for:THEN \*\n
  229. Replace with:THEN\n
  230. Also, in Zap, you can turn on the `Strip Spaces' option.
  231.  
  232.  
  233. Q: Why am I getting an error reported for the last line of my program?
  234. A: The BASIC interpreter often mistakenly reports the last line when
  235.    another, more unusual error has occurred.  For this reason many BASIC
  236.    programmers like to put `REM this line cannot generate an error' as the
  237.    last line of their program.
  238.  
  239. Q: How can I reset my machine?
  240. A: Try this piece of assembler:
  241.     SWI "XOS_Reset"
  242.     SWI "XOS_EnterOS"
  243.     MOV r0, #&3800000
  244.     LDR r0, [r0]
  245.     STR r0, [r0, -r0]
  246.     MOV pc, #0
  247.  
  248. Q: How can I reset someone else's machine over the network?
  249. A: Go away, schoolchild.  Your teachers have enough hassles already.
  250.  
  251.  
  252. 5a. Some nasty C++ gotchas
  253.  
  254. When using cin to read input from the user:
  255.  
  256. > int main()
  257. > {
  258. >    int a;
  259. >    cout << "enter a ";
  260. >    cin >> a;
  261. >    return(0);
  262. > }
  263.  
  264. you may find you need to add cin.sync_with_stdio() before the I/O is
  265. performed.
  266.  
  267. > The code seems to compile correctly, but when run the "enter a " gets output
  268. > to the screen but then it just continually inputs, as if its missing a read
  269. > return key.
  270.  
  271.  
  272. 5b.  Some nasty assembler gotchas
  273.  
  274. This from Richard Walker:
  275. > If you want to predefine a flag for objasm, don't even think about doing it
  276. > in the way that !Objasm does it. For example, I need a logical flag set
  277. > {TRUE}. I ask !Objasm to define it, and it produces a command line
  278.  
  279. > ... -predefine REAL_FP -predefine SETL -predefine TRUE ...
  280.  
  281. > which, oddly enough, doesn't work.
  282.  
  283. > The example in the manual is also as wrong...
  284. > The code that actually worked (in a makefile) was:
  285.  
  286. > -predefine "REAL_FP SETL {TRUE}"
  287.  
  288.  
  289.  
  290. 6. What does this strange error message mean?
  291.  
  292. Error:    No writable memory at this address
  293. Cause:    This error is produced by FileSwitch when it finds there's no
  294.     memory at the address that it was asked to load a file at.  The
  295.     most common cause of this is wimpslot too small.
  296. Fix:    Make the wimpslot larger.  Alternatively, are you maybe running
  297.     something else in your !Run file which adjusts the wimpslot before
  298.     your application starts?
  299.  
  300. Error:    AMU crashes unexpectedly
  301. Cause:    The self decompression code (for example in the C compiler) does
  302.     not check the memory limit, which results in parts of AMU in memory
  303.     being overwritten. When control returns to AMU, it crashes
  304. Fix:    Make the wimpslot larger
  305.  
  306. Error:    EMT trap
  307. Cause:    The program is linked with UnixLib, which unlike the standard C
  308.     library cannot automatically extent the stack. UnixLib generates
  309.     this cryptic message when it detects that it has run out of stack
  310.     space
  311. Fix:    Make the wimpslot larger
  312.  
  313. Error:    Data Lost
  314. Cause:    Generally, you've got a write-protected floppy
  315. Fix:    Move the write protect tab on the floppy ;-)
  316.  
  317. As a rule of thumb, if you are lost for a solution, see if the problems
  318. goes away when you increase the wimpslot.
  319.  
  320. 7. I just don't understand how to do <this>.  Got any examples?
  321.  
  322. How to:
  323.  
  324. Use taskwindows properly (Matthew Wilcox)
  325. ftp://ftp.barnet.ac.uk/pub/Acorn/taskwin.arc
  326.  
  327. Write a wimp application in Logo (Matthew Wilcox)
  328. http://www.york.ac.uk/~mrw103/logotask.arc.bin
  329.  
  330. Use OS_GBPB to read a directory listing (Nick Clark)
  331. ftp://ftp.barnet.ac.uk/pub/Acorn/programming/doc/osgbpb.txt
  332.  
  333. 8. Some collections of software you may wish to look at first.
  334.  
  335. These people or companies have put together their own collections of stuff.
  336. The stuff here is not necessarily disjoint from that in the previous section.
  337. If you see something here that should be referenced explicitly above, let
  338. me know.
  339.  
  340. Acorn Computers Ltd
  341. http://www.acorn.co.uk/
  342.  
  343. ARM Ltd
  344. http://www.arm.com/Architecture/CodeExamples/
  345.  
  346. Robin Watts
  347. http://www.comlab.ox.ac.uk/oucl/users/robin.watts/Docs/
  348.  
  349. Hensa Micros
  350. ftp://micros.hensa.ac.uk/micros/arch/riscos/
  351.  
  352. Alun Da Penguin
  353. ftp://penguin.fluff.org/pub/arch/
  354.  
  355. 9. I have a comment/suggestion/complaint
  356.  
  357. Fine.  Mail me.  I only took this on after seeing yet another thread on
  358. random number generation.  If you think you can do better, go ahead.
  359.  
  360. 10. Credits
  361.  
  362. Contributors include:
  363.  
  364. Paul Boddie
  365. Nick Clark
  366. Kieran Mansley
  367. Peter Naulls
  368. Richard Walker
  369. Matthew Wilcox
  370. Mark Wooding
  371.